package com.neusoft;

import java.io.FileInputStream;
import java.io.FileNotFoundException;

public class DemoInputStream {

    public static void main(String[] args) throws Exception {
        //创建输入流对象  FileInputStream
        //作用:读取数据
        FileInputStream fis = new FileInputStream("javase0923\\a.txt");
        //读取数据:方法
        //int len = fis.read();
        //System.out.println(len);
        int len = 0;
        byte[] bytes = new byte[1024];
        while((len=fis.read(bytes))!=-1){
            System.out.println(len);
            System.out.println(new String(bytes));
        }
        //关闭流对象
        fis.close();
    }
}
